package com.yuandengta.yomall.product.controller;

import com.yuandengta.yomall.product.service.SkuInfoService;
import com.yuandengta.yomall.product.vo.SkuItemVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Controller
public class ItemController {

    @Autowired
    private SkuInfoService skuInfoService;

    /*sku 详情*/
    @GetMapping("/{skuId}.html")
    public String item(@PathVariable("skuId") Long skuId, Model model) {
        SkuItemVO skuItemVO = skuInfoService.item(skuId);
        model.addAttribute("skuItemVO", skuItemVO);
        return "item";
    }


}
